package com.soar.recruitment.common.app;

import com.soar.framework.app.FrameworkApplication;
import com.soar.framework.app.FrameworkConstants;
import com.soar.recruitment.common.util.DeviceUniqueFactory;
import com.soar.recruitment.common.util.Logs;
import com.soar.recruitment.common.util.SOARUtil;


public class SOARBaseApplication extends FrameworkApplication {

    // instance
    private static SOARBaseApplication instance;
    public static SOARBaseApplication getInstance() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;

        initOkHttp(SOARConstants.TIMEOUT_CONNECT, SOARConstants.TIMEOUT_READ, SOARConstants.TIMEOUT_WRITE);
        initHttpHeaderParams();
    }

    /**
     * 初始化基础 Header 参数
     */
    private void initHttpHeaderParams() {
        FrameworkConstants.PARAMS_APP_ID = SOARUtil.getVersion(this);
        FrameworkConstants.PARAMS_UDID = DeviceUniqueFactory.getInstance().getUniqueId();

        Logs.d("wplog", "appId:" + FrameworkConstants.PARAMS_APP_ID);
        Logs.d("wplog", "udid:" + FrameworkConstants.PARAMS_UDID);
    }

}
